#ifndef MYCHART_H
#define MYCHART_H
#include <QChartView>
#include <QMouseEvent>
#include <QValueAxis>
QT_CHARTS_USE_NAMESPACE


#if _MSC_VER >= 1600
#pragma execution_character_set("utf-8")
#endif


class myChartView : public QChartView
{
    Q_OBJECT
public:
    explicit myChartView(QChart* chart ,QWidget *parent = nullptr);
    explicit myChartView(QWidget *parent = nullptr);
    ~myChartView();
protected:
    void mousePressEvent(QMouseEvent* event);
    void mouseReleaseEvent(QMouseEvent* event);
    void mouseMoveEvent(QMouseEvent* event);
    void wheelEvent(QWheelEvent* event);

private:
    bool isPressed;
    QPoint pressPos;//按下位置
    QPoint befMovePos, curMovePos;//前一个移动位置和当前移动位置



};


#endif // MYCHART_H
